package com.shop.controller;


import com.shop.entity.PmsBrand;
import com.shop.service.PmsBrandService;
import com.shop.service.PmsProductService;
import com.shop.vo.ResultJson;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

import javax.annotation.Resource;
import java.util.List;

/**
 * <p>
 * 商品表 前端控制器
 * </p>
 *
 * @author lpx610
 * @since 2023-11-09
 */
@RestController
@RequestMapping("/pmsProduct")
public class PmsProductController {

    @Resource
    private PmsProductService pmsProductService;

    @Resource
    private PmsBrandService pmsBrandService;

    @GetMapping("/getIdAndName")
    public ResultJson<List<PmsBrand>> getName() {
        return ResultJson.success(pmsBrandService.getName());
    }

    @PostMapping("/upload")
    public ResultJson<String> upload(MultipartFile file) {
        return ResultJson.success(pmsProductService.upload(file));
    }

}
